﻿ 

	
<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <meta name="keywords" content="职位">  
    <meta name="description" content="职位">  
    <title>选择职位</title>  
    
    <%@ include file="/WEB-INF/inc/default.jsp"%>
    <jsp:include page="/WEB-INF/inc/dic.jsp"/>

</head>  
 <script>
      
         function doSelect(pcallback){
           var rows = $('#dg').datagrid('getSelections');
            if (!rows||rows.length==0){
            	 $.messager.alert('提示','请选择行','info');
            	 return;
            }
            if (!rows||rows.length>1){
            	 $.messager.alert('提示','不能选择多行','info');
            	 return;
            }

            var job={};
            job.id=rows[0].id;
            job.name=rows[0].name;
            if (rows){  
            	 
                if (callback) callback(job);
                //else if (parent.chooseCv) parent.chooseCv(cv);    //否则执行默认父级选择函数
                closeWin();
            }  
         }
       
  </script>
<body>  
    
      
    <table id="dg" style="height:300px"  
            url="/project/contractJob/joblist.do"  
            toolbar="#toolbar" pagination="true"  
            rownumbers="true" fitColumns="true" loadMsg="正在查询,请稍候..." singleSelect="false">  

    </table>  
    <div  style="text-align:center">  
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doSelect();">确定</a>  
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeWin()">关闭</a>  

    </div>
    
    <div id="toolbar">      
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="find()">查询</a>
    </div>  
    
    <!-- query form窗体(开始) -->  
    <div id="dlg_query" style="display:none;">  
    	  <!--
        
        <form itemId="fmquery" method="post" novalidate>  
            
              
	        		     <div class="fitem">  
                     <label style="width:100px">客户:</label>                       
                     <input name="custId" class="easyui-numberbox">                       
                   </div>	        		     
	        		         		     
	        		     <div class="fitem">  
                     <label style="width:100px">职位名:</label>                                            
                     <input name="name" class="easyui-box">                       
                   </div> 
	        		    	     
        	  	   	 <div class="fitem">  
                     <label style="width:100px">一级行业:</label>                                            
                     
                     
                     
                     
                     <input class="easyui-combobox" name="industry_parent" style="width:120px;"  data-options="data:__getCategoryByParant('INDUSTRY', 0),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote'
		                            	,onSelect: function(rec){                                  
		                            	      console.log(this);
                                        $('#job_second_industry').combobox('loadData', __getCategoryByParant('INDUSTRY', rec.id));  
                                        $('#job_second_industry').combobox('setValue',null);
                                        
                                    }
		                            	 ">
                     
                   </div>      	
                   <div class="fitem">  
                     <label style="width:100px">二级行业:</label>                                            
                     
                     
                     <input class="easyui-combobox" id="job_second_industry" itemId="second_industry" name="industry" style="width:120px;"  data-options="data:{},valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>
                   
        	  	   	 <div class="fitem">  
                     <label style="width:100px">一级职能:</label>                                            
                     
                     
                     <input class="easyui-combobox" name="function_parent" style="width:120px;"  data-options="data:__getCategoryByParant('JOB', 0),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' 
			                               ,onSelect: function(rec){              
                                           $('#job_second_job').combobox('loadData', __getCategoryByParant('JOB', rec.id));  
                                           $('#job_second_job').combobox('setValue',null);
                                       }
			                               ">
                     
                   </div>      	
                   <div class="fitem">  
                     <label style="width:100px">二级职能:</label>                                            
                     
                     
                     <input class="easyui-combobox" id="job_second_job" name="function" style="width:120px;"  data-options="data:__getCategory('JOB'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>
        	  	   	 <div class="fitem">  
                     <label style="width:100px">职级:</label>                                            
                     
                     
                     <input class="easyui-combobox" name="level" style="width:200px;"  data-options="data:__getCategory('JOBLEVEL'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>      	
	        		     <div class="fitem">  
                     <label style="width:100px">职位负责人:</label>                                            
                     <input class="easyui-combobox"   name="jobManager" style="width:120px;"  data-options="url:'/auth/systemUser/userlist.do',valueField:'account', textField:'name', multiple:false,panelHeight:'auto',mode:'remote' ">
                   </div> 
        	  	   	 <div class="fitem">  
                     <label style="width:100px">职位合作人:</label>                                            
                     
                     
                     <input class="easyui-combobox"   name="jobCooper" style="width:120px;"  data-options="url:'/auth/systemUser/userlist.do',valueField:'account', textField:'name', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>      	
	        		     <div class="fitem">  
                     <label style="width:100px">职位参与人:</label>                       
                     <input class="easyui-combobox"   name="jobPartner" style="width:120px;"  data-options="url:'/auth/systemUser/userlist.do',valueField:'account', textField:'name', multiple:false,panelHeight:'auto',mode:'remote' ">
                   </div>	        		     
	        		    
        	  	   	 <div class="fitem">  
                     <label style="width:100px">职位状态:</label>                                            
                     
                     
                     <input class="easyui-combobox" name="status" style="width:100px;"  data-options="data:__getConstantCategory('JobStatus'),valueField:'code', textField:'value', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>      	
	        		          		     
              
              
        </form>
        <div  style="text-align:center">  
                    <a href="javascript:void(0)" itemId="btn-query" class="easyui-linkbutton" iconCls="icon-ok" ">查询</a>  
                    <a href="javascript:void(0)" itemId="btn-close" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>  
        </div> 
        -->
    </div> 
    <!-- query form窗体(结束) -->  
    
    <script type="text/javascript">  
        var url;  
        
        
		    
		    var queryWin = $.window({
		       		 title:"职位查询",
		       		 tplRef:"dlg_query",//这个属性指定模板id
		       		 height:400,		       		 
		       		 closed:true,		       		 
		       		 onComplete:function(){
		       		 	  //窗口里面的初始化,最好是在这个事件里面进行
		       		 	  var curWin=this;
		       		 	  var doForm=curWin.find('#fm_query');
		       		 	  curWin.doForm=doForm;
		       		 	  this.find('a[itemId="btn-close"]').click(function(){       		 	  	
		       		 	  	   curWin.window('close');
		       		 	  });
		       		 	  this.find('a[itemId="btn-query"]').click(function(){
		       		 	  			                 		  
		                 		 //var formdata=$('#fm_query').formToArray(); 
		                 		 curWin.window('close');
		                 		 var formdata=curWin.find('form[itemId="fmquery"]').formToArray();  
		                 		 curWin.openWin.query(formdata);
		              });
		       		   
		       		 }
		    });
        
        
        
        function find(){  
              
                //$('#dlg_query').dialog('open').dialog('setTitle','查询');  
                
                //url = '/project/contractJob/joblist.do';  
                 queryWin.window('open');   
                 queryWin.openWin=window; 
              
        } 
        	
        function query(formdata){  
                
                $('#dg').datagrid({
	                  queryParams: array2json(formdata)
                });
              
        }
        
        //生成grid的字段,需要字典的自动转换
        $('#dg').datagrid({
        	   columns:[[
        	   	
        	   	   {field:'companyName',title:'客户', width:100}        	   	   
        	   	   ,{field:'name',title:'职位名', width:100}
        	   	   ,{field:'jobNo',title:'职位编号', width:100,hidden:true}
        	   	           	   	   
        	   	   ,{field:'jobNature',title:'合作性质', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getCategroyCodeValue('JOB_NATURE', value);
        	   		      },hidden:true
        	   	     }
        	   	   ,{field:'hrContacter',title:'客户职位联系人', width:100,hidden:true}  
        	   	   ,{field:'jobManager',title:'职位负责人', width:100,hidden:true}  
        	   	   ,{field:'jobCooper',title:'合作成员', width:100,hidden:true}  
        	   	   ,{field:'status',title:'状态', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getConstantCategoryCodeValue('JobStatus', value);
        	   		      }
        	   	     }  
        	   	   ,{field:'jobStatus',title:'职位进展', width:100}    
        	   	    ,{field:'recomCount',title:'推荐数', width:100,hidden:true}
        	   	    ,{field:'interviewCount',title:'客户面试数', width:100,hidden:true}
        	   	    ,{field:'backgroundCount',title:'背景调查', width:100,hidden:true}
        	   	    ,{field:'offerCount',title:'录用', width:100,hidden:true}
        	   	    ,{field:'createDt',title:'创建时间', width:100,hidden:true}
        	   	      
        	   	
        	   	
        	   ]]
        	   ,onDblClickRow: function(rowIndex, rowData){
        	    	$('#dlg').dialog('open').dialog('setTitle','修改职位');                  
                $('#fm').form('load','/project/contractJob/get.do?id='+rowData.id);  
                url = '/project/contractJob/update.do';        	    	
        	    }
        }); 
        //完成-生成grid的字段
        
        
        
    </script>  
     
     

     
     
     
</body>  
</html>